//
//  XianLiang.m
//  KCFurProject
//
//  Created by ios程序员 on 15/11/19.
//  Copyright © 2015年 ios程序员. All rights reserved.
//

#import "XianLiang.h"

@implementation XianLiang

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.xLImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, WI/5*3, 90*HEIGH)];
        [self.xLImageView setImage:[UIImage imageNamed:@"2015"]];
        [self.contentView addSubview:self.xLImageView];
        
        self.priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(WI/5*3+10*WIDTH, 20*WIDTH,100*WIDTH, 20*HEIGH)];
        self.priceLabel.text = @"500.00💰";
        self.priceLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.priceLabel];
        
        self.baoMingLabel = [[UILabel alloc] initWithFrame:CGRectMake(WI/5*3+10*WIDTH, 25*WIDTH, 160*WIDTH, 10*HEIGH)];
        self.baoMingLabel.text = @"报名达到500人,预计降到450💰";
        CGSize size = [self sizeThatFits:CGSizeMake(self.baoMingLabel.frame.size.height, MAXFLOAT)];
        CGRect frame = self.baoMingLabel.frame;
        frame.size.height = size.height;
        [self.baoMingLabel setFrame:frame];
        self.baoMingLabel.numberOfLines = 0;
        self.baoMingLabel.font = [UIFont systemFontOfSize:9];
        self.baoMingLabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:self.baoMingLabel];
        
        self.baoMingButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.baoMingButton.frame = CGRectMake(WI/5*3+10*WIDTH, 60*HEIGH, 60*WIDTH, 15*HEIGH);
        [self.baoMingButton setTitle:@"开始报名" forState:UIControlStateNormal];
        [self.baoMingButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
        self.baoMingButton.titleLabel.font = [UIFont systemFontOfSize:12];
        self.baoMingButton.backgroundColor = [UIColor whiteColor];
        self.baoMingButton.layer.cornerRadius = 5;
        [self.baoMingButton.layer setMasksToBounds:YES];
        [self.baoMingButton.layer setBorderColor:(__bridge CGColorRef _Nullable)([UIColor blackColor]) ];
        [self.baoMingButton.layer setBorderWidth:1.0];
        [self.contentView addSubview:self.baoMingButton];
        
        self.slider = [[UISlider alloc] initWithFrame:CGRectMake(WI/5*3+10*WIDTH, 75*HEIGH, 120*HEIGH, 15*HEIGH)];
        [self.slider setThumbImage:[UIImage imageNamed:@"shu"] forState:UIControlStateNormal];
        self.slider.minimumValue = 0;
        self.slider.maximumValue = 500;
        self.slider.maximumTrackTintColor = [UIColor grayColor];
        self.slider.minimumTrackTintColor = [UIColor blackColor];
//        self.slider.thumbTintColor = [UIColor redColor];
        
        [self.contentView addSubview:self.slider];
    }
    return self;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
